﻿#region License
/* ****************************************
 * Allrights reserved by BlueLotus7 
 * 
 * Last updated: 2009-10-01
 * 
 * BlueLotus7@126.com
 * BlueLotus7@vip.qq.com
 * ****************************************/
#endregion
using System;
using System.Diagnostics;

namespace BlueLotus7
{
    public abstract class BaseException : System.Exception
    {
        public enum ErrorCode
        {
            Unknown = 100,
            Unauthorized = 400,
            SessionExpired = 401,
            SessionReplecement = 402,
            ResourceNotFound = 404,
            ServiceBroken = 500,
            DependentServiceIssue = 600
        }

        public int FaultCode
        {
            get;
            protected set;
        }

        public Guid ErrorId
        {
            get;
            protected set;
        }

        public BaseException(string exceptionMessage)
            : base(exceptionMessage)
        {
            this.FaultCode = (int)(ErrorCode.Unknown);
            this.ErrorId = Guid.NewGuid();
        }

        public BaseException(string exceptionMessage, System.Exception innerException)
            : base(exceptionMessage, innerException)
        {
            this.FaultCode = (int)ErrorCode.Unknown;
            this.ErrorId = Guid.NewGuid();
        }
    }
}
